//
//  SRHistoryDataSR03+Desc.m
//  CareRing
//
//  Created  on 2024/12/17.
//
    

#import "CAHistoryDataSR03+Desc.h"
#import <DateTools/DateTools.h>
#import "ConfigModel.h"

@implementation CAHistoryDataSR03 (Desc)
-(NSString *)wholeDesc
{
    NSMutableString *infoString = [NSMutableString new];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:self.timeStamp.doubleValue];
//    ;
    [infoString appendFormat:@"Date:%@, ", [date formattedDateWithFormat:_L2(L_DATE_FMT)]];
    
    [infoString appendFormat:@"UUid:%@, ", self.dataUuid];
    
    [infoString appendFormat:@"Hr:%@, ", self.deviceModifyHeartRate];
    
    [infoString appendFormat:@"HRV:%@, ", self.hrv];
    
    [infoString appendFormat:@"Resp rate:%@, ", self.breathRate];

    [infoString appendFormat:@"Spo2:%@%%, ", self.bloodOxygen];

    [infoString appendFormat:@"Skin Temp:%@, ", self.skinTemp];

    [infoString appendFormat:@"steps:%@, ", self.steps];

    [infoString appendFormat:@"Motions:%@, ", self.soprtTimes];
    
    [infoString appendFormat:@"Charging:%d, ", self.isCharging];

    [infoString appendFormat:@"Is wear:%@, ", self.isWear];

    [infoString appendFormat:@"In workout:%@, ", self.isSportMode];


    [infoString appendFormat:@"Battery:%@%%, ", self.battery];


    [infoString appendFormat:@"Measure Mode:%@ ", self.measureeModeDesc];

    

    return infoString;
    
}

-(NSString *)measureeModeDesc {
    NSString *str= @"";
    switch (self.measureType) {
      
        case SR03HIS_MEASURE_TYPE_HR :  // 测量模式-心率
        {
            str = @"HeartRate";
        }
            break;
        case  SR03HIS_MEASURE_TYPE_OXYGEN: // 测量模式-血氧
        {
            str = @"Spo2";

        }
            break;
        default:
            break;
    }
    return str;
}


@end
